<template>
  <div>
    <el-brand></el-brand>
    <el-button class="btn" type="primary" plain size="small" @click="add">添加</el-button>
    <v-list @edit="edit"></v-list>
    <v-dialog :info="info" @cancel="cancel" ref="dialogInfo"></v-dialog>
  </div>
</template>

<script>
import vList from "./list.vue";
import vDialog from "./dialog.vue";
export default {
  data() {
    return {
        info:{
            isShow:false,
            isAdd:true
        },
    };
  },
  methods: {
      add(){
          this.info.isShow = true
          this.info.isAdd = true
      },
      edit(e){
          this.info.isShow = true
          this.info.isAdd = false
          this.$refs.dialogInfo.lookup(e)
      },
      cancel(e){
          this.info.isShow = e
      },
  },
  components: {
    vList,
    vDialog
  }
};
</script>

<style  scoped>
.btn {
  margin: 30px;
}
</style>
